<?php
$conn = mysql_connect('localhost', 'root', '');
if (!$conn) {
    die('Could not connect: ' . mysql_error());
} else {
    mysql_select_db("j2eedevelopers", $conn);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Coming Soon</title>
        <link href="tools/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="tools/jquery.min.js"></script> 
        <script type="text/javascript" src="tools/cufon-yui.js"></script>
        <script type="text/javascript" src="tools/Bebas_400.font.js"></script>
        <script type="text/javascript" src="tools/Bell_Gothic_Std_300.font.js"></script>
        <script type="text/javascript">
            Cufon.replace('a.logo', {fontFamily: 'Bebas'});
            Cufon.replace('a.logo span', {fontFamily: 'Bell Gothic Std'});
        </script>

    </head>
    <body>
        <div class="main_container">
            <div class="header">
                <a class="logo" href="#">J2EEDEVELOPERS.NET<span>developer's network</span></a>
            </div>
            </body>
    </html>


<html>
    <head>
        <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    </head>
    <body bgcolor="99CCFF">     
        <style>
        label1 {
        color: white;}
        .focus {color:red;}
        label2 {
        color: white;
        }
        label3 {
        color: white;
        }
        </style>
        
        <input type="radio" id="type1" checked name="type" value="1" checked/><label1>J2EE DEVELOPERS</label1> &nbsp;&nbsp;
        <input type="radio" id="type2" name="type" value="2"/><label2>J2EE PROJECTS</label2>&nbsp;&nbsp;
        <input type="radio" id="type3" name="type" value="3"/><label3>ALL</label3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <!-- <input type="button" id="type4" name="type" value="Notify" disabled style="background-color:blanchedalmond" onclick="Me();"/> -->
     <input type="submit" id="type4" name="type" value="Notify" style="display:none;"/>
        <!-- add button to send email -->
        <!--<div id="display_data" style="margin-top: 20px;"></div> -->
        <div id="display_data">
        <?php
        $result = mysql_query("SELECT * FROM j2eedevelopers WHERE Site='j2eedevelopers.net'", $conn);
        echo "<table border='1' width=35% height=50%>
    <tr>
       <th>Email</th>
        <th>Date</th>
        <th>Type</th>
    </tr>";
        while ($row = mysql_fetch_array($result)) {
            $email = $row['Email'];
            
            $cdt = $row['cdt'];
            echo "<tr>
	           <td>$email</td>
	           
                   <td>$cdt</td>
                   <td><input type='checkbox' id='typeid' name='checkarrname[]' value='".$email."' onClick='getcheckarrnames()' /></td>
	   </tr>";
        }
        echo "</table>";
        ?>
        </div>
        <script>

            $('#type1').click(function() {
                //alert('sdafsd');
                if ($('#type1').is(":checked")) {
                    $.post("adminhome.php",
                            {'type1': $(this).val()},
                            function(data) { //alert(data);
                                $("#display_data").html(data);
                            });                    
                } else {
                    $("#display_data").html('');
                }
            });

            $('#type2').click(function() {
                //alert('sdafsd');
                if (!$('#type2').is(":checked")) {
                    $("#display_data").html('');
                } else {
                    $.post("adminhome.php",
                            {type2: $(this).val()},
                    function(data) { //alert(data);
                        $("#display_data").html(data);
                    });
                }
            });

            $('#type3').click(function() {
                //alert('sdafsd');
                if (!$('#type3').is(":checked")) {
                    $("#display_data").html('');
                } else {
                    $.post("adminhome.php",
                            {type3: $(this).val()},
                    function(data) { //alert(data);
                        $("#display_data").html(data);
                    });
                }
            });
            
           function getcheckarrnames(){
        var checkedval = $('[name="checkarrname[]"]:checked').length;
        
            if(checkedval>0){
            $("#type4").show();
            }else{
            $("#type4").hide();
            }
        //var names =document.getElementsByName('checkarrnme[]');
        //alert(names.length);
            }
        </script>
        
    </body>
</html>
